package com.ssm.service.impl;

import com.ssm.dao.OrganizationDao;
import com.ssm.entity.Organization;
import com.ssm.service.OrganizationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("organizationService")
public class OrganizationServiceImpl implements OrganizationService {

    @Resource
    private OrganizationDao organizationDao;

    @Override
    public void addOrganization(Organization organization) {
        organizationDao.insertOrganization(organization);
    }

    @Override
    public void updateOrganization(Organization organization) {
        organizationDao.updateOrganization(organization);
    }

    @Override
    public void removeBatchOrganization(Integer[] ids) {
        organizationDao.deleteBatchOrganization(ids);
    }

    @Override
    public List<Organization> listOrganization(Organization organization) {
        return organizationDao.selectOrganization(organization);
    }


    @Override
    public Organization getOrganization(Integer id) {
        return organizationDao.selectOneOrganization(id);
    }

    @Override
    public int selectOrganizationByname(String name) {
        return organizationDao.selectOrganizationByname(name);
    }
}
